﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DONGACS.Assembler;
using DONGACS.DAO;
using DONGACS.Domain;
using DONGACS.DTO;
using DONGACS.SERVICE.Base;

namespace DONGACS.SERVICE
{
    public class JobTitlesService : BaseService<JobTitlesDto, JobTitles>
    {
        JobTitlesAssembler JobTitlesAssembler = new JobTitlesAssembler();
        JobTitlesDao JobTitlesDao = new JobTitlesDao();


        public IList<JobTitlesDto> GetAllJobTitles()
        {
            IList<JobTitles> jobTitlesList = JobTitlesDao.GetAllJobTitles();

            IList<JobTitlesDto> jobTitlesDtoList = JobTitlesAssembler.ConvertToDataTransferObjectList(jobTitlesList);

            return jobTitlesDtoList;
        }

        public JobTitlesDto GetJobTitlesById(string jobTitlesId)
        {
            JobTitles jobTitles = JobTitlesDao.GetJobTitlesById(jobTitlesId);

            JobTitlesDto jobTitlesDto = JobTitlesAssembler.ConvertToDataTransferObject(jobTitles);

            return jobTitlesDto;
        }

        public bool AddNewJobTitles(JobTitlesDto jobTitlesDto)
        {
            return this.JobTitlesDao.AddNewJobTitles(this.JobTitlesAssembler.ConvertToBusinessObject(jobTitlesDto));
        }
        
        public bool AddNewJobTitles(JobTitlesDto jobTitlesDto, ref int idReturn)
        {
            return this.JobTitlesDao.AddNewJobTitles(this.JobTitlesAssembler.ConvertToBusinessObject(jobTitlesDto), ref idReturn);
        }
        
        public bool ShiftDelete(string jobTitlesId)
        {
            return this.JobTitlesDao.ShiftDelete(jobTitlesId);
        }

        public bool Delete(string jobTitlesId)
        {
            return this.JobTitlesDao.Delete(jobTitlesId);
        }

        public bool Update(JobTitlesDto jobTitlesDto)
        {
            return this.JobTitlesDao.Update(this.JobTitlesAssembler.ConvertToBusinessObject(jobTitlesDto));
        }

        public JobTitlesDto GetJobTitleByName(string jobTitleName)
        {
            return this.JobTitlesAssembler.ConvertToDataTransferObject(this.JobTitlesDao.GetJobTitleByName(jobTitleName));
        }
    }
}
